Skip to content

Bottom sheet lists#98

Merged
barry-observation merged 6 commits into
developfrom
feature/bottom-sheet-lists
Jun 10, 2026
Merged

Bottom sheet lists#98
barry-observation merged 6 commits into
developfrom
feature/bottom-sheet-lists

Conversation

@barry-observation

Copy link
Copy Markdown
Contributor

Required to complete https://github.com/observation/obsidentify/issues/1248.

Five components that are used in the bottom sheet with search input can be shared between the apps. I'll leave some comments on little things that I found along the way.

We first need to merge this. Then we can rebase the related PRs in Observation and ObsIdentify.

Comment thread src/components/InputPanel.tsx Outdated
Comment on lines +33 to +36
// todo: 48 and 36 should be input heights and we should make them dynamically themed
const paddingVertical = label
? (48 - (styles.headerTextStyle.lineHeight! + styles.value.lineHeight!)) / 2
: (36 - styles.value.lineHeight!) / 2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik zou dit liever dynamisch maken zodat de input iets groter is in Observation dan in ObsIdentify. Voor nu heb ik het zo gelaten omdat het al meer dan genoeg werk voor 1 story was.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dat kan door paddingVertical niet af te laten hangen van de lineHeight, maar een fixed value te gebruiken.

Aan de andere kant, Karel heeft ideeën over hoe groot elementen moeten zijn (veelvoud van 8 of 16) om te zorgen voor een evenwichtige en consistente vulling van de schermen. Dan zou Karel dus moeten aangeven hoe dit in beide apps eruit moet zien, en kunnen wij de implementatie van de UI daarop baseren.

const styles = useStyles(createStyles)

const iconMarginRight = subLabel ? theme.margin.common : theme.margin.half
const containerPaddingVertical = subLabel ? 7 : 13

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze hard-coded padding is niet zo mooi maar ik kon geen betere manier verzinnen.

Comment thread src/components/InputPanel.tsx Outdated
Comment on lines +33 to +36
// todo: 48 and 36 should be input heights and we should make them dynamically themed
const paddingVertical = label
? (48 - (styles.headerTextStyle.lineHeight! + styles.value.lineHeight!)) / 2
: (36 - styles.value.lineHeight!) / 2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dat kan door paddingVertical niet af te laten hangen van de lineHeight, maar een fixed value te gebruiken.

Aan de andere kant, Karel heeft ideeën over hoe groot elementen moeten zijn (veelvoud van 8 of 16) om te zorgen voor een evenwichtige en consistente vulling van de schermen. Dan zou Karel dus moeten aangeven hoe dit in beide apps eruit moet zien, en kunnen wij de implementatie van de UI daarop baseren.

Comment thread src/components/InputPanel.tsx Outdated
)
}

// todo: dit werd geexporteerd als een observer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graag TODO in hoofdletters, en de tekst in het Engels. Wat moet hier nog gebeuren?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ik denk dat die weg kan. Het viel me op dat er eerder een observer was gebruikt en daar had ik een notitie van gemaakt voor mezelf. Volgens mij is het geen probleem dus ik kan het weghalen.

Comment thread src/components/InputPanel.tsx Outdated
Comment on lines +4 to +5
import { Icon } from '@observation.org/react-native-components'
import { type Theme, useStyles, useTheme } from '@observation.org/react-native-components/theme'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import paden zijn niet correct, moeten interne paden zijn.

Comment thread src/components/ListItem.tsx Outdated
}

const ListItem = ({ icon, onPress, label, subLabel, extraSubLabel, selected = false }: Props) => {
Log.trace('ListItem', onPress)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan deze log weg?

Comment on lines +14 to +20
test('Rendering', () => {
// WHEN
const { toJSON } = render(<ListItem onPress={onPress} label="Read this!" />)

// THEN
expect(toJSON()).toMatchSnapshot()
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze kan weg, wordt herhaald in de volgende unit test.

Comment thread src/components/InputPanel.tsx Outdated
headerTextStyle: {
...theme.font.extraSmall,
lineHeight: theme.font.extraSmall.fontSize,
letterSpacing: 0.3, // todo: should this be dynamic?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property letterSpacing is in points. Het font is extra small, voor ObsIdentify is dat 10pt. Een letterSpacing van 0.3pt geeft dus 3% meer ruimte. Je kunt dit vrij simpel dynamisch maken:

Suggested change
letterSpacing: 0.3, // todo: should this be dynamic?
letterSpacing: 0.03 * theme.font.extraSmall.fontSize

@SjaakSchilperoort SjaakSchilperoort left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paar kleine dingen nog, verder 👌🏻

Comment thread src/components/InputPanel.tsx Outdated
const theme = useTheme()
const styles = useStyles(createStyles)

// todo: 48 and 36 should be input heights and we should make them dynamically themed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Het is fijn als VSCode de TODO's kan vinden, dus:

Suggested change
// todo: 48 and 36 should be input heights and we should make them dynamically themed
// TODO: 48 and 36 should be input heights and we should make them dynamically themed

Comment thread src/components/ListItem.tsx Outdated
import React from 'react'
import { StyleSheet, TouchableOpacity, View } from 'react-native'

import { Icon, IconProps } from '@observation.org/react-native-components'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier nog een onnodige dependency op zichzelf. Idem in de bijbehorende unit test

@barry-observation barry-observation merged commit 01e1de0 into develop Jun 10, 2026
2 checks passed
@barry-observation barry-observation deleted the feature/bottom-sheet-lists branch June 10, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants